package com.java.jvm.loader;

public class BreakDoubleParentAppClassLoaderTests {//AppClassLoader
    public static void main(String[] args) throws ClassNotFoundException {
        String baseDir="E:\\TCGBIV\\DEVCODES\\CGB2202CODES\\";
        BreakDoubleParentAppClassLoader loader1=
               new BreakDoubleParentAppClassLoader(baseDir);
        Class<?> aClass1 = loader1.loadClass("pkg.HelloJVM");
        System.out.println(aClass1.getClassLoader());

        BreakDoubleParentAppClassLoader loader2=
                new BreakDoubleParentAppClassLoader(baseDir);
        Class<?> aClass2 = loader2.loadClass("pkg.HelloJVM");
        System.out.println(aClass2.getClassLoader());
        System.out.println(aClass1==aClass2);
        //false表示同一个class在内存中可以存在多个字节码对象（类对象）
    }
}
